//
// Source code recreated from ConfigVo .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.ht.modules.system.online.config.util;

import freemarker.template.Configuration;
import freemarker.template.Template;
import java.io.StringWriter;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class FreemarkerHelper {
    private static final Logger log = LoggerFactory.getLogger(FreemarkerHelper.class);
    private static Configuration _tplConfig;

    public FreemarkerHelper() {
    }

    public static String parseTemplate(String tplName, String encoding, Map<String, Object> paras) {
        try {
            StringWriter swriter = new StringWriter();
            Template mytpl;
            mytpl = _tplConfig.getTemplate(tplName, encoding);
            mytpl.process(paras, swriter);
            return swriter.toString();
        } catch (Exception var5) {
            log.error(var5.getMessage(), var5);
            return var5.toString();
        }
    }

    public static String parseTemplate(String tplName, Map<String, Object> paras) {
        return parseTemplate(tplName, "utf-8", paras);
    }

    public static void main(String[] args) {
        String html = parseTemplate("com/ht/modules/system/online/config/engine/tableTemplate.ftl", (Map)null);
        System.out.println(html);
    }

    static {
        _tplConfig = new Configuration(Configuration.VERSION_2_3_28);
        _tplConfig.setNumberFormat("0.#####################");
        _tplConfig.setClassForTemplateLoading(FreemarkerHelper.class, "/");
    }
}
